import { createApp } from 'vue';
import { createPinia } from 'pinia';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';

import App from './App.vue';
import router from './router';
import './styles/main.css';
import { useAuthStore } from './stores/auth';
import { useContentStore } from './stores/content';

const app = createApp(App);

const pinia = createPinia();

app.use(pinia);
app.use(router);
app.use(ElementPlus);

const authStore = useAuthStore();
const contentStore = useContentStore();

authStore.bootstrap().finally(async () => {
  await contentStore.bootstrap();
  app.mount('#app');
});
